package com.sc.sc250601.cook.mapper;

import com.sc.sc250601.cook.pojo.Comment1;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface Comment1Mapper {
    int deleteByPrimaryKey(Long id);

    int insert(Comment1 record);

    int insertSelective(Comment1 record);

    Comment1 selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Comment1 record);

    int updateByPrimaryKeyWithBLOBs(Comment1 record);

    int updateByPrimaryKey(Comment1 record);


    //添加一个评论
    int saveComment(Comment1 comment);
    //查询父级评论
    List<Comment1> findByParentIdNull(@Param("ParentId") Long ParentId,@Param("targetType") Integer targetType,@Param("targetId") Long targetId);
    //查询一级回复
    List<Comment1> findByParentIdNotNull(@Param("id") Long id);
    //查询二级以及所有子集回复
    List<Comment1> findByReplayId(@Param("childId") Long childId);

}